#include<stdio.h>
#include<unistd.h>
#include<fcntl.h>
#include<string.h>
#include<sys/shm.h>
int main(){
  int shm_id = shmget(0x12121212,1024,IPC_CREAT | 0664);
  if(shm_id < 0){
     perror("shmget");
     return 0;   
    }
  void* addr = shmat(shm_id,NULL,SHM_RDONLY);
  if(addr == NULL){
    perror("shmat");
    return 0;
   }
   printf("read_shm : %s\n",(char*)addr);
   while(1){
     sleep(1);
   }
   shmdt(addr);                                                                 return 0;
} 

